﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;

namespace BHair.Base
{
    public partial class frmczselect : Form
    {
        public frmczselect()
        {
            InitializeComponent();
        }
        string constr = ConfigurationManager.ConnectionStrings["BHair.Properties.Settings.BHairDBConnectionString"].ConnectionString;
        private void frmczselect_Load(object sender, EventArgs e)
        {
            string sql =string.Format( "SELECT [ID] ,[cardid] as 卡号,[持卡人],[项目名称],[充值次数],[项目单价],[项目金额],[经手人],[充值时间],[单号],[备注] FROM [项目充值明细] where cardid='{0}'",chuanzhi.czcard);
            SqlConnection conn = new SqlConnection(constr);
            conn.Open();
            DataTable dt = new DataTable();
            SqlDataAdapter sda = new SqlDataAdapter(sql,conn);
            sda.Fill(dt);
            this.dataGridView1.DataSource = dt;
            conn.Close();
        }
    }
}
